<template>
    <div>
        {{state}}
        <button @click="add">{{state?'已在书架':'添加书架'}}</button>
    </div> 
</template>
<script>
export default {
    props:['id','state'],
    methods:{
        add(){
            let state = !this.state;
            this.$bus.$emit('add',state,this.id);
        }
    }
}
</script>
